#ifndef CONF_H
#define CONF_H

#include <QObject>
#include <QSettings>
#include <QString>

class Conf : public QObject
{
    Q_OBJECT
public:
    explicit Conf(QObject *parent = 0);
    explicit Conf(QString fileName, QObject *parent = 0);

    Q_INVOKABLE void reload();
    Q_INVOKABLE void save();

    Q_INVOKABLE QString get_plataforma();
    Q_INVOKABLE QString get_log();

    Q_INVOKABLE QString get_id_departamento();
    Q_INVOKABLE void set_id_departamento(QString id_departamento);

    Q_INVOKABLE QString get_model_balanca();
    Q_INVOKABLE QString get_port_balanca();
    Q_INVOKABLE QString get_baudrate_balanca();
    Q_INVOKABLE void set_model_balanca(QString model);
    Q_INVOKABLE void set_port_balanca(QString port);
    Q_INVOKABLE void set_baudrate_balanca(QString baudrate);

    Q_INVOKABLE QString get_primary_database_host();
    Q_INVOKABLE QString get_primary_database_name();
    Q_INVOKABLE QString get_primary_database_user();
    Q_INVOKABLE QString get_primary_database_password();
    Q_INVOKABLE void set_primary_database_host(QString host);
    Q_INVOKABLE void set_primary_database_name(QString database);
    Q_INVOKABLE void set_primary_database_user(QString user);
    Q_INVOKABLE void set_primary_database_password(QString password);

    Q_INVOKABLE QString get_secondary_database_host();
    Q_INVOKABLE QString get_secondary_database_name();
    Q_INVOKABLE QString get_secondary_database_user();
    Q_INVOKABLE QString get_secondary_database_password();
    Q_INVOKABLE void set_secondary_database_host(QString host);
    Q_INVOKABLE void set_secondary_database_name(QString database);
    Q_INVOKABLE void set_secondary_database_user(QString user);
    Q_INVOKABLE void set_secondary_database_password(QString password);

    Q_INVOKABLE QString get_admin_interface_user();
    Q_INVOKABLE QString get_admin_interface_password();

    Q_INVOKABLE QString get_interface_type();

    QString getConf(QString group, QString key);
    void setConf(QString group, QString key, QString value);
signals:

public slots:

private:
    QSettings* settings;
};

#endif // CONF_H
